package com.example.eureka;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;


/**
 * 测试demo的controller
 *
 * @author zcc ON 2018/2/8
 **/
@Controller
public class HelloController {

    @GetMapping(value = "/login")
    public String hello(Model model) {
        String name = null;
        model.addAttribute("fail_msg", name);
        model.addAttribute("login","/login");
        return "login";
    }
    @PostMapping(value = "/login")
    public String posthello(Model model) {
        String name = "密码错误";
        model.addAttribute("fail_msg", name);
        model.addAttribute("login","/login");
        return "login";
    }

}